﻿using Anke.SHManage.MSSQLDAL;
using Microsoft.Reporting.WebForms;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Anke.SHManage.Web.Reports
{
    public partial class CheckPayModeWebForm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Data_Binding();
            }
        }

        private void Data_Binding()
        {
            string Station = Convert.ToString(Request.QueryString["Station"]);
            string ifCheck = Request.QueryString["ifCheck"];
            DateTime StartTime = Convert.ToDateTime(Request.QueryString["StartTime"]);
            DateTime EndTime = Convert.ToDateTime(Request.QueryString["EndTime"]);
            this.ReportViewer1.LocalReport.DataSources.Clear();
            this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/CheckPayStation.rdlc");
            //Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1);
            //Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1);
            //this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed });
            LSDAL dal = new LSDAL();
            DataTable dt1 = dal.Get_TJ_CheckPayStation(StartTime, EndTime, Station, ifCheck);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetTJ_CheckPayStation", dt1));
            //DataSetTJ_CheckPayStation
            this.ReportViewer1.LocalReport.Refresh();

        }
    }
}